package com.sinux.generality.provider.pay.entity;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 支付订单表
 * </p>
 *
 * @author sinux
 * @since 2023-05-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="GptPayOrder对象", description="支付订单表")
public class GptPayOrder implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "支付订单id")
    private Long payOrderId;

    @ApiModelProperty(value = "业务订单id")
    private Long businessOrderId;

    @ApiModelProperty(value = "支付总金额")
    private BigDecimal total;

    @ApiModelProperty(value = "商品描述")
    private String description;

    @ApiModelProperty(value = "1-待支付 2-支付成功 3-支付失败 4-已关闭  6-支付中")
    private Integer state;

    @ApiModelProperty(value = "支付者openid")
    private String payerOpenId;

    @ApiModelProperty(value = "支付用户userId")
    private Long wxUserId;

    @ApiModelProperty(value = "支付完成时间")
    private LocalDateTime successTime;

    @ApiModelProperty(value = "支付成功使用的预支付订单号")
    private String successPrepayId;

    @ApiModelProperty(value = "支付成功对应微信订单号")
    private String successTransactionId;

    @ApiModelProperty(value = "交易类型")
    private String tradeType;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    private LocalDateTime modifyTime;

    @ApiModelProperty(value = "支付类型：1-微信支付")
    private Integer payType;

    @ApiModelProperty(value = "该支付订单已退金额")
    private BigDecimal refundMoney;

    @ApiModelProperty(value = "退款状态：0-未发生退款，1-部分退款，2-退款已完成")
    private Integer refundState;

    /**
     * 支付子单细项
     */
    @TableField(exist = false)
    private List<GptPayOrderDetail> details;

    /**
     * 扫描支付url
     */
    @TableField(exist = false)
    private String codeUrl;
    /**
     * 预支付id
     */
    @TableField(exist = false)
    private String prepayId;


}
